package com.myspring.sample.lookup_with_argument;

import org.springframework.context.annotation.*;

@Configuration(proxyBeanMethods = false)
@ComponentScan()
public class LookupTest {
    /**
     * 参考1： https://blog.csdn.net/duxd185120/article/details/109125440
     * 参考2： https://www.baeldung.com/spring-lookup
     */
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.register(LookupTest.class);
        context.refresh();
        
        System.out.println("user对象class类型：" + context.getBean(CarManager.class));
        System.out.println("car对象：" + context.getBean(CarManager.class).getCar("BYD").toString());
        System.out.println("car对象：" + context.getBean(CarManager.class).getCar("特斯拉").toString());
 
    }
    

}